import java.util.function.ToIntFunction;

/**
 * Created by Time to be on 26.06.2014.
 */
public class toTranslitConverter {


   public static void main(String[] args) {

       String a = "Я просто хочу, чтоб эта строка отобразилась транслитом!)";
       char[] b = a.toCharArray();

       System.out.println(a);
       int length = a.length();

       for (int i = 0; i < a.length(); i++) {
           switch (b[i]) {
               case 'ц':
               case 'Ц': length++; break;
               case 'ч':
               case 'Ч': length++; break;
               case 'ш':
               case 'Ш': length++; break;
               case 'щ':
               case 'Щ': length = length + 2; break;
               case 'ю':
               case 'Ю': length++; break;
               case 'я':
               case 'Я': length++; break;
               default: break;
           }

       }

       char[] c = new char[length];

       int j = 0;
       for (int i = 0; i < a.length(); i++) {
           switch (b[i]) {
               case 'а':
               case 'А':


               case 'к':
               case 'К':

               case 'л':
               case 'Л':

               case 'м':
               case 'М':

               case 'н':
               case 'Н':

               case 'о':
               case 'О':

               case 'п':
               case 'П':

               case 'б':
               case 'Б':

               case 'и':
               case 'И': {b[i] = (char) ((int)b[i] - 975); c[j] = b[i]; } break;

               case 'в':
               case 'В': {b[i] = (char) ((int)b[i] - 956); c[j] = b[i]; } break;

               case 'ж':
               case 'Ж':

               case 'г':
               case 'Г': {b[i] = (char) ((int)b[i] - 972); c[j] = b[i]; } break;

               case 'д':
               case 'Д':

               case 'е':
               case 'Е': {b[i] = (char) ((int)b[i] - 976); c[j] = b[i]; } break;

               case 'ё':
               case 'Ё': {b[i] = (char) ((int)b[i] - 1004); c[j] = b[i]; } break;

               case 'з':
               case 'З': {b[i] = (char) ((int)b[i] - 957); c[j] = b[i]; } break;

               case 'й':
               case 'Й': {b[i] = (char) ((int)b[i] - 1042); c[j] = b[i]; } break;

               case 'р':
               case 'Р':

               case 'с':
               case 'С':

               case 'т':
               case 'Т': {b[i] = (char) ((int)b[i] - 974); c[j] = b[i]; } break;

               case 'у':
               case 'У': {b[i] = (char) ((int)b[i] - 970); c[j] = b[i]; } break;

               case 'ф':
               case 'Ф': {b[i] = (char) ((int)b[i] - 990); c[j] = b[i]; } break;

               case 'х':
               case 'Х': {b[i] = (char) ((int)b[i] - 989); c[j] = b[i]; } break;

               case 'ъ':
               case 'Ъ': {b[i] = (char) ((int)b[i] - 1059); c[j] = b[i]; } break;

               case 'ы':
               case 'Ы': {b[i] = (char) ((int)b[i] - 982); c[j] = b[i]; } break;

               case 'ь':
               case 'Ь': {b[i] = (char) ((int)b[i] - 1061); c[j] = b[i]; } break;

               case 'э':
               case 'Э': {b[i] = (char) ((int)b[i] - 1000); c[j] = b[i]; } break;


               case 'ц': {c[j] = 't'; c[j+1] = 's'; j++; } break;
               case 'Ц': {c[j] = 'T'; c[j+1] = 's'; j++; } break;

               case 'ч': {c[j] = 'c'; c[j+1] = 'h'; j++; } break;
               case 'Ч': {c[j] = 'C'; c[j+1] = 'h'; j++; } break;

               case 'ш': { c[j] = 's'; c[j+1] = 'h'; j++; } break;
               case 'Ш': { c[j] = 'S'; c[j+1] = 'h'; j++; } break;

               case 'щ': { c[j] = 's'; c[j+1] = 'c'; c[j+2] = 'h'; j = j + 2; } break;
               case 'Щ': { c[j] = 'S'; c[j+1] = 'c'; c[j+2] = 'h'; j = j + 2; } break;

               case 'ю': { c[j] = 'i'; c[j+1] = 'y'; j++; } break;
               case 'Ю': { c[j] = 'I'; c[j+1] = 'y'; j++; } break;

               case 'я': { c[j] = 'i'; c[j+1] = 'a'; j++; } break;
               case 'Я': { c[j] = 'I'; c[j+1] = 'a'; j++; } break;

               default: c[j]=b[i]; break;
           }
           j++;
       }

       for (int i = 0; i < length; i++) {
           System.out.print(c[i]);
       }
   }
}

/* Output:
Я просто хочу, чтоб эта строка отобразилась транслитом!)
Ia prosto hochy, chtob eta stroka otobrazilas' translitom!)
*/
